package com.atguigu.gulimall.order;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * 使用rabbitmq
 * 1.引入amqp场景，RabbitAutoConfiguration就会自动生效
 * 2.给容器中自动配置了
 *      RabbitTemplate、AmqpAdmin、CachingConnectionFactory、RabbitMessagingTemplate
 *      所有的属性都是 @ConfigurationProperties(prefix = "spring.rabbitmq")
 *          RabbitPropertie
 * 4、配置文件中配置 spring.rabbitmq信息
 * 5.@EnableRabbit: @EnableXxxx 开启功能
 * 6.监听消息：使用@RabbitListener；必须有@EnableRabbit
 *  @RabbitListener：类和方法上(监听哪些队列即可)
 *  @RabbitHandler：方法上(重载区分不同的消息)
 */
@EnableRabbit
@EnableDiscoveryClient
@SpringBootApplication
@MapperScan(basePackages = "com.atguigu.gulimall.order.dao")
public class GulimallOrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallOrderApplication.class, args);
    }

}
